package com.unisal.java;

import java.util.ArrayList;

public class MenuPanquecasDaCasaIterator implements Iterator{

	ArrayList<ItemDoMenu> itens;
	Integer posicao = 0;
	
	public MenuPanquecasDaCasaIterator(ArrayList<ItemDoMenu> itens) {
		this.itens = itens;
	}
	
	@Override
	public boolean hasNext() {
		if (posicao >= itens.size()) {
			return false;
		}
		else { 
			return true;
		}
	}

	@Override
	public Object next() {
		ItemDoMenu itemDoMenu = itens.get(posicao);
		posicao += 1;
		return itemDoMenu;
	}

}
